package com.example.qt.ptplatform.controller;

import com.example.qt.ptplatform.service.PineconeService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class PineconeController {

    private final PineconeService pineconeService;

    public PineconeController(PineconeService pineconeService) {
        this.pineconeService = pineconeService;
    }

    @GetMapping("/pinecone/create-index")
    public String createIndex() {
        try {
            pineconeService.createIndex();
            return "索引创建成功";
        } catch (Exception e) {
            return "创建索引时出错: " + e.getMessage();
        }
    }
}

